﻿using Polly;

namespace Bigway.Common.Utils;

#pragma warning disable S3881
public class PollyResilienceContextUser(CancellationToken token = default): IDisposable
#pragma warning restore S3881
{

    public ResilienceContext Context { get; } = ResilienceContextPool.Shared.Get(token);

    public void Dispose()
    {
        ResilienceContextPool.Shared.Return(Context);
    }
}